#include <stdio.h>

int func2(int idx);

int func1(int idx, int idx2, int idx3, int *x) {
  switch (idx) {
    case 0: *x = 0x000; break;
    case 1: *x = 0x100; break;
    case 2: *x = 0x200; break;
    case 3: *x = 0x300; break;
    case 4: *x = 0x400; break;
    case 5: *x = 0x500; break;
    case 6: *x = 0x600; break;
    case 7: *x = 0x700; break;
    default: *x = -1; break;
  }
  switch (idx2) {
    case 0: return 0x800;
    case 1: return 0x700;
    case 2: return 0xc00;
    case 3: return 0x500;
    case 4: return 0xa00;
    case 5: return 0x300;
    case 6: return 0x200;
    case 7: return func2(idx3);
    default: return -1;
  }
  return 0;
}

int main()
{
  int x, y, z, c;
  x = 1;
  y = 7;
  z = 3;
  func1(x, y, z, &c);
  return 0;
}
